import { request } from "@umijs/max";

/**
 * 增加
 * @param data
 * @returns
 */
export function add_core(data: Types.Core.ICoreInfo): Promise<Types.Http.Response<null>> {
  return request("/api/v1/admin/control_core/create", {
    method: "POST",
    data
  });
}

/**
 * 编辑
 * @param data
 * @returns
 */
export function edit_core(data: Types.Core.ICoreInfo): Promise<Types.Http.Response<null>> {
  return request("/api/v1/admin/control_core/edit", {
    method: "POST",
    data
  });
}

/**
 * 删除接口
 * @param id
 * @returns
 */
export function delete_core(id: string): Promise<Types.Http.Response<null>> {
  return request("/api/v1/admin/control_core/delete/" + id);
}

/**
 * 获取 core
 * @param params
 * @returns
 */
export function get_core_list(
  params: Types.Core.ICoreSearch
): Promise<Types.Http.Response<Types.Core.ICoreList>> {
  return request("/api/v1/admin/control_core/list", { params });
}

/**
 * 获取详情
 * @param id
 * @returns
 */
export function detail_core(id: string): Promise<Types.Http.Response<Types.Core.ICoreInfo>> {
  return request("/api/v1/admin/control_core/detail/" + id);
}
